<!--  -->
<template>
<div class=''>
     <Nav title="通用设置">
        <template v-slot:left>
            <span class="back" @click="$router.back()"></span>
        </template>
    </Nav>
    <div class="setup_con">
        <!-- 个人头像 -->
        <div class="setup_portrait show_public flex justify-between aligin-center">
            <span class="color-black">个人头像</span>
            <img :src="infoDetail.user_headimg" alt="">
        </div>
        <!-- 昵称 -->
        <div class="setup_con_item show_public flex justify-between aligin-center">
            <span class="color-black">昵称</span>
            <span class="color-gray">{{infoDetail.nick_name}}</span>
        </div>
        <div class="setup_con_item show_public flex justify-between aligin-center">
            <span class="color-black">性别</span>
            <span class="color-gray">{{infoDetail.sex}}</span>
        </div>
        <div class="setup_con_item show_public flex justify-between aligin-center">
            <span class="color-black">手机号</span>
            <span class="color-gray">{{infoDetail.mobile}}</span>
        </div>

        <div class="setup_con_item show_public flex justify-between aligin-center">
            <span class="color-black">我的邀请码</span>
            <span class="color-gray">{{infoDetail.ucode}}</span>
        </div>
        <!-- 清除缓存 -->
        <router-link to="">
            <div class="setup_cache show_public flex justify-between aligin-center">
                <span class="color-black">我的上级</span>
                <div class="flex aligin-center">
                    <span class="color-gray pr-14" v-if="infoDetail.pid">{{infoDetail.p_n}}</span>
                </div>
            </div>
        </router-link>
    </div>

    <!-- 按钮 -->
    <div class="setup_foot btn_foot">
        <button class="this_exitbtn btn_public flex justify-center aligin-center" @click="$store.commit('exit')">退出账号</button>
    </div>
</div>
</template>

<script>
import Nav from "../../components/Nav";
import {userInfo} from "../../api/api"
export default {
    components: {Nav},
    data() {
    return {
        infoDetail:{}
    };
    },
    computed: {},
    watch: {},
    methods: {

    },
    created() {

    },
    mounted() {
        userInfo().then(({data:{result}})=>{
            this.infoDetail=result
        })
    },
    updated() {}, //生命周期 - 更新之后
    destroyed() {}, //生命周期 - 销毁完成
}
</script>
<style lang='less' scoped>
@import url("../../assets/style/mixin.less");
//@import url(); 引入公共css类

// 内容
.setup_public span {
    font-size: 13px;
}
// 个人头像
.setup_portrait {
    padding: 10px 20px;
}
.setup_portrait>img {
    width: 55px;
    height: 55px;
    border-radius: 100%;
}
.setup_con_item,.setup_cache {
    height: 55px;
    padding: 0 20px;
}
.setup_cache {
    margin-top: 34px;
}
</style>